

import java.util.*;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author c0909h1169
 */
class Fibo_n extends Thread
{
    @Override
    public void run()
    {
        int i=1;
        int j=1;
        int x = i+j;
        int n;
        Scanner scan = new Scanner(System.in);
        System.out.println("Nhap n: ");
       // n= Integer.parseInt(scan.nextLine());
        n = scan.nextInt();
        for(i=1;i<n;i++)
        {
            i=j;
            j=x;
            x= i+j;
            System.out.println(i);
        }
    }
}
class Fibo_1 extends Thread
{
    @Override
    public void run()
    {
        int i=1;
        int j=1;
        int x = i+j;

       // n= Integer.parseInt(scan.nextLine());
        for(i=1;i<50;i++)
        {
            i=j;
            j=x;
            x= i+j;
            System.out.println(i);
        }
    }
}
public class Homework3 {
    public static void main(String args[])
    {
        Fibo_1 F1 = new Fibo_1();
        F1.start();
        Fibo_n Fn = new Fibo_n();
        Fn.start();
        System.out.println("Thread Fibo_1 is alive: "+F1.isAlive());
        System.out.println("Thread Fibo_1 is alive: "+Fn.isAlive());
        F1.suspend();
        System.out.println("Thread Fibo_1 is alive: "+F1.isAlive());
        F1.resume();
        Fn.stop();
        System.out.println("Thread Fibo_1 is alive: "+Fn.isAlive());
    }


}

